package com.xiaohu.myspace.database.entity;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * UserInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "USER_INFO", catalog = "myspace")
public class UserInfo extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6340239558735611252L;
	// Fields

	private Integer id;
	private String userName;
	private String userPassword;
	private String userEmail;
	private String userFavorite;
	private String userAddress;
	private Integer userSex;
	private Integer userAge;
	private String userId;
	private String userPhoto;
	private Integer userGrade;
	// 1.web,2.android,3.ios;
	private int clientType = 1;

	// Constructors

	/** default constructor */
	public UserInfo() {
	}

	/** minimal constructor */
	public UserInfo(String userName, String userPassword, Integer userSex,
			Integer userAge, String userId, Integer userGrade) {
		this.userName = userName;
		this.userPassword = userPassword;
		this.userSex = userSex;
		this.userAge = userAge;
		this.userId = userId;
		this.userGrade = userGrade;
	}

	/** full constructor */
	public UserInfo(String userName, String userPassword, String userEmail,
			String userFavorite, String userAddress, Integer userSex,
			Integer userAge, String userId, String userPhoto, Integer userGrade) {
		this.userName = userName;
		this.userPassword = userPassword;
		this.userEmail = userEmail;
		this.userFavorite = userFavorite;
		this.userAddress = userAddress;
		this.userSex = userSex;
		this.userAge = userAge;
		this.userId = userId;
		this.userPhoto = userPhoto;
		this.userGrade = userGrade;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "user_name", nullable = false, length = 15)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "user_password", nullable = false, length = 20)
	public String getUserPassword() {
		return this.userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	@Column(name = "user_email", length = 20)
	public String getUserEmail() {
		return this.userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	@Column(name = "user_favorite", length = 100)
	public String getUserFavorite() {
		return this.userFavorite;
	}

	public void setUserFavorite(String userFavorite) {
		this.userFavorite = userFavorite;
	}

	@Column(name = "user_address", length = 50)
	public String getUserAddress() {
		return this.userAddress;
	}

	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}

	@Column(name = "user_sex")
	public Integer getUserSex() {
		return this.userSex;
	}

	public void setUserSex(Integer userSex) {
		this.userSex = userSex;
	}

	@Column(name = "user_age")
	public Integer getUserAge() {
		return this.userAge;
	}

	public void setUserAge(Integer userAge) {
		this.userAge = userAge;
	}

	@Column(name = "user_id", nullable = true, length = 20)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "user_photo", length = 20)
	public String getUserPhoto() {
		return this.userPhoto;
	}

	public void setUserPhoto(String userPhoto) {
		this.userPhoto = userPhoto;
	}

	@Column(name = "user_grade")
	public Integer getUserGrade() {
		return userGrade;
	}

	public void setUserGrade(Integer userGrade) {
		this.userGrade = userGrade;
	}

	@Transient
	public int getClientType() {
		return clientType;
	}

	public void setClientType(int clientType) {
		this.clientType = clientType;
	}

}